The TUnitReply Structure
You use theTUnitReply
structure to specify the data being sent with theOTSndUReply
function (page 3-112) and the data being read with theOTRcvUReply
function (page 3-115). You pass a pointer to theTUnitReply
structure as a parameter to each of these functions.The
TUnitReply
structure is defined by theTUnitReply
data type.
struct TUnitReply { TNetbuf addr; TNetbuf opt; TNetbuf udata; OTSequence sequence; }; typedef struct TUnitReplyTUnitReply;
Field Description
addr
- A
TNetbuf
structure that contains information about
an address.- In the
reply
parameter to theOTSndUReply
function, this field specifies the location and size of a buffer containing the address of the requester. You are not required to provide this information. If you do not want to provide address information, set theaddr.len
field to 0. To specify an address, you must allocate a buffer for the address and initialize it to the destination address. Then you set theaddr.buf
field to point to the buffer and set theaddr.len
field to the length of the address.- In the
reply
parameter to theOTRcvUReply
function, this field specifies the location and size of a buffer containing the address of the endpoint sending the reply. You must allocate a buffer into which the address is placed when the function returns, and you must set theaddr.buf
field to point to this buffer. You must also set theaddr.maxlen
field to the maximum size of the buffer.opt
- A
TNetbuf
structure that contains information about the options associated with this reply.- In the
reply
parameter to theOTSndUReply
function, this field specifies the location and size of a buffer containing the options that you set for this reply. You must set theopt.len
field to the length of the options or to 0 if you don't want to specify any options.- In the
reply
parameter to theOTRcvUReply
function, this field specifies the location and size of a buffer containing the association-related options that the responder has sent using theOTSndUReply
function. You must allocate a buffer to hold option information and set thereply.opt
field to point to it. When theOTRcvUReply
function returns, it fills this buffer with option information. You must set thereply.maxlen
field to the maximum size necessary to hold option information.udata
- A
TNetbuf
structure that contains information about the reply data.- In the
reply
parameter to theOTSndUReply
function, this field specifies the location and size of a buffer containing the reply data sent to the requester. You allocate a buffer that contains the reply data, set theudata.buf
field to point to that buffer, and set theudata.len
field to specify the size of the reply. The size cannot exceed the value specified for thetsdu
field of theTEndpointInfo
structure for the endpoint.- If you are sending data that is not stored contiguously, the
udata.buf
field is a pointer to anOTData
structure that describes the first data fragment. In this case, you must set theudata.len
field tokNetbufDataIsOTData
.- In the
reply
parameter to theOTRcvUReply
function, this field specifies the location and size of a buffer into which the function places the reply data on return. You must allocate a buffer to hold the data, set theudata.buf
field to point to it, and set theudata.maxlen
field to the maximum size of this buffer. The size must not exceed the value specified for thetsdu
field of theTEndpointInfo
structure for this endpoint.- If you are doing a no-copy receive, the
udata.buf
field is a pointer to anOTBuffer
pointer. In this case, you must set theudata.maxlen
field to the constantkNetbufDataIsOTBufferStar
.sequence
- A long that specifies the transaction ID for this transaction.
- When sending a reply, you set this field to the value for this field that you read with the
OTRcvURequest
function.- When receiving a reply, if you have sent out multiple requests, you use this field to match incoming replies to outgoing requests.